Authorizations
The access token received from the authorization server in the OAuth 2.0 flow.
Headers
Indicates the origin (scheme, hostname, and port).
Query Parameters
A code that identifies the voucher.
"2CpRCE2c"
A tracking identifier of a user that validated the voucher. This identifier is generated during voucher validation based on your internal ID (e.g., email, database ID) during the first request. This is a hashed customer source ID. If the request is performed for the first time, pass the internal ID to track the customer. Although not all information is required, the extra information helps prevent fraud.
A positive integer in the smallest currency unit (e.g. 100 cents for $1.00) representing the total amount of the order. This is the sum of the order items' amounts.
The session unique ID assigned by Voucherify or your own unique session ID. Sending an existing ID will result in overwriting an existing session. If no session key is provided, then a new ID will be generated.
"ssn_yQGMTeKBSw8OOuFPwlBEjzGy8d8VA9Ts"
Value for the period of time that the session is active. Units for this parameter are defined by the session_ttl_unit
parameter.
Defines the type of unit in which the session time is counted.
HOURS
, DAYS
, MINUTES
, SECONDS
, MILLISECONDS
, MICROSECONDS
, NANOSECONDS
Metadata key value pairs.
Array of order items.
The session is required to establish a session between multiple parallel validation and redemption requests. This parameter is required to establish a new session. The session locks the redemption quantity by 1 and additionally the redemption gift credits specified within the request for a gift card and the loyalty points for a loyalty card.
Customer details. Customer source ID and/or customer metadata.
Order details.
Response
Returns information whether the voucher is valid in the context of the parameter values provided in the query parameters. Moreover, it returns a hashed source identifier which can be used as tracking ID in future calls. If a validation session is established, then the session details will be returned as well. Read more on <!-- [validation sessions](..docs/guides/campaign_recipes/Locking-Validation-Session.md) -->validation sessions.
- Valid - Discount Code
- Valid - Gift Card
- Valid - Loyalty Card
- Not Valid
Response schema model for validating a voucher using POST v1/vouchers/{code}/validate
.
Response schema model for validating a discount code using POST v1/vouchers/{code}/validate
.
Indicates whether the voucher is valid within the context of the parameters provided in the request body.
Contains list of items that qualify in the scope of the discount. These are definitions of included products, SKUs, and product collections. These can be discounted.
Contains list of items that do not qualify in the scope of the discount. These are definitions of excluded products, SKUs, and product collections. These CANNOT be discounted.
Hashed customer source ID.
This is an object representing an order with calculated discounts applied using the voucher code.
- Order object - Effect: Apply to order
- Order object - Effect: Apply to items
Voucher code.
Contains information about the discount to be applied to the order. This is an object representing the discount that the customer would receive in the context of the provided request body parameters. If the discount is calculated based on a formula, this object will return either the discount calculated based on the formula or the fallback value.
- Amount Discount
- Percent Discount
- Fixed Discount
- Unit Discount, Product
- Unit Discount, SKU
- Unit Discount, multiple items
- Shipping Discount
The metadata object stores all custom attributes assigned to the code. A set of key/value pairs that you can attach to a voucher object. It can be useful for storing additional information about the voucher in a structured format.
Activation timestamp defines when the voucher starts to be active in ISO 8601 format. Voucher is inactive before this date.
"2022-10-04T00:00:00.000Z"
Expiration timestamp defines when the voucher expires in ISO 8601 format. Voucher is inactive after this date.
"2022-10-31T00:00:00.000Z"
Voucher's parent campaign name.
Voucher's parent campaign's unique ID.
"camp_W8DJVd8J0btqXT6FBwn7BSkC"
Schema model for session
lock object. The session object contains information about the session key that was used to establish a session between multiple parallel validation and redemption requests.